//
//  DisturbingCell.m
//  ECO
//
//  Created by zl on 2019/9/24.
//  Copyright © 2019 谷银行. All rights reserved.
//

#import "DisturbingCell.h"

@implementation DisturbingCell
- (UIButton *)BackGroudBtn{
    if (!_BackGroudBtn) {
        _BackGroudBtn = [[UIButton alloc]initWithFrame:CGRectMakeCustom(0, 0, 320, 47)];
        [_BackGroudBtn addTarget:self action:@selector(BackBtn:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _BackGroudBtn;
}
- (UILabel *)Title{
    if (!_Title) {
        _Title = [[UILabel alloc]initWithFrame:CGRectMakeCustom(15, 13, 100, 21)];
        _Title.text = @"免打扰";
    }
    return _Title;
}
- (UISwitch *)Switch{
    if (!_Switch) {
        _Switch = [[UISwitch alloc]initWithFrame:CGRectMakeCustom(320-47-10, 9, 47, 29)];
    }
    return _Switch;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.BackGroudBtn];
        [self.BackGroudBtn addSubview:self.Title];
        [self.BackGroudBtn addSubview:self.Switch];
    }
    return self;
}
- (void)BackBtn:(UIButton *)send{
    if (self.delegate && [self.delegate respondsToSelector:@selector(DisturbingCellClick)]) {
        [self.delegate performSelector:@selector(DisturbingCellClick) withObject:nil];
    }
}
@end
